<template>
  <div>
    <el-form :model="items" label-width="80px">
      <el-form-item label="尺寸">
        <el-checkbox label="锁定长宽比" name="type"></el-checkbox>
      </el-form-item>
      <el-form-item label="宽度">
        <el-input-number size="mini" v-model="items.width"></el-input-number>
      </el-form-item>
      <el-form-item label="高度">
        <el-input-number size="mini" v-model="items.height"></el-input-number>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "echartStyle",

  data() {
    return {
      items: {
        width: 0,
        height: 0
      },
      echartItems: []
    };
  },
  watch: {
    items: {
      handler() {
         this.echartItems.settings.size.width = this.items.width;
         this.echartItems.settings.size.height = this.items.height;
        //  this.$emit('replaceStyle',this.echartItems)
      },


    //   immediate: true,

      deep: true
    }
  },

  methods: {
    getStyleList(item) {
      this.echartItems = item;
      this.items.width = item.settings.size.width;
      this.items.height = item.settings.size.height;
    },
  }
};
</script>
